package red;

import arjuna.JavaSim.Simulation.Scheduler;

public class Job {
	private double ResponseTime;
	private double ArrivalTime;
	public final double Tranfer=0.1; 	
	//servidor que envia
	private int servidor;
	//cliente que recive
	private int cliente;
	
	public Job (int Ncliente , int Nservidor)//la N es para decir que hace referencia al numero 
	{
		
		servidor=Nservidor;
		cliente=Ncliente;
		ResponseTime = 0.0;
		ArrivalTime = Scheduler.CurrentTime();
		MachineShop.TotalJobs++;
	}

	public void finished () {
		
		MachineShop.ErasedJobs++;
		ResponseTime = Scheduler.CurrentTime() - ArrivalTime;
		MachineShop.TotalResponseTime += ResponseTime;
		MachineShop.meanDelay.setValue( ResponseTime );
	}
	public int getServidor()
	{
		return servidor;
	} 
	
	public int getCliente()
	{
		return cliente;
	}

}
